package com.saikuo.service.utils;

import java.math.BigDecimal;
import java.math.RoundingMode;

/**
 * Created by chenzhuo on 16/8/2.
 */
public class NumberUtils {
    private NumberUtils() {

    }

    public static double formatDoubleTo2Scale(double num) {
        BigDecimal formatNum = BigDecimal.valueOf(num)
                .setScale(2, RoundingMode.UP);
        return formatNum.doubleValue();
    }
}
